package com.authManager.commons.feignApi;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.authManager.commons.feignApi.hystric.SysUserApiHystric;
import com.authManager.entity.SysUser;
import com.commons.base.model.AdminPage;
import com.commons.base.model.ResultData;

@FeignClient(value = "authManager-server", fallback = SysUserApiHystric.class)
public interface SysUserApi {
	static final String projectAaaApiBaseUrl = "/authManager-server/admin/sysUser";

	/**
	 * 添加【用户信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/saveSysUser", method = { RequestMethod.POST })
	public ResultData<Object> saveSysUser(@RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "phone",required = false) String phone);

	/**
	 * 修改【用户信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/editSysUser", method = { RequestMethod.POST })
	public ResultData<Object> editSysUser(@RequestParam(value = "sysUserId",required = true) String sysUserId,
			@RequestParam(value = "phone",required = false) String name, @RequestParam(value = "phone",required = false) String phone);

	/**
	 * 删除【用户信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/delSysUser", method = { RequestMethod.POST })
	public ResultData<Object> delSysUser(@RequestParam(value = "sysUserId",required = true) Long sysUserId);

	/**
	 * 获取【用户信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/getSysUser", method = { RequestMethod.POST })
	public ResultData<SysUser> getSysUser(@RequestParam(value = "sysUserId",required = true) Long sysUserId);

	/**
	 * 列表【用户信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/listSysUser", method = { RequestMethod.POST })
	public ResultData<AdminPage<SysUser>> listSysUser(
			@RequestParam(value = "pageNum",defaultValue = "1", required = false) Integer pageNum,
			@RequestParam(value = "pageSize",defaultValue = "10", required = false) Integer pageSize,
			@RequestParam(value = "sysUserId",required = false) String sysUserId, @RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "phone",required = false) String phone, @RequestParam(value = "start_creater",required = false) String start_creater,
			@RequestParam(value = "end_creater",required = false) String end_creater);
}
